/*
 * Activator
 */

package ocp.bundles.esb.impl;

import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.Constants;


/**
 * Activador del bundle
 * @author paco
 */
public class Activator implements BundleActivator {
    
    public static BundleContext bc = null;

    private static Esb esb = null; 


    public void start(BundleContext bc) throws Exception {
        Activator.bc = bc;

        esb = new Esb("Esb" , bc );
        esb.start();

        System.out.println(bc.getBundle().getHeaders().get( Constants.BUNDLE_NAME) + " comenzado.");
    }

    public void stop(BundleContext bc) throws Exception {
        
        esb.stop();
        esb = null;
        
        Activator.bc = null;
        System.out.println(bc.getBundle().getHeaders().get( Constants.BUNDLE_NAME) + " terminado.");
    }

}
